import forumAxios from '../utils/request'

const BASE_URL = '/message'

export async function getContacts(userId) {
    console.log(userId);

    const resp = await forumAxios.get(BASE_URL + '/getContacts', {
        params: {
            userId: userId
        }
    });
    console.log(resp);

    return resp
}

export async function getFollowers(userId) {
    console.log(userId);

    const resp = await forumAxios.get(BASE_URL + '/getFollowers', {
        params: {
            userId: userId
        }
    });
    console.log(resp);

    return resp
}

export async function getStrangers(userId) {
    console.log(userId);

    const resp = await forumAxios.get(BASE_URL + '/getStrangers', {
        params: {
            userId: userId
        }
    });
    console.log(resp);

    return resp
}

export async function getChatMessages(userId1, userId2) {

    const resp = await forumAxios.get(BASE_URL + '/getChatMessages', {
        params: {
            user1: userId1,
            user2: userId2
        }
    });
    console.log(resp);

    return resp
}

export async function addMessage(message) {
    console.log(message);

    const resp = await forumAxios.post(BASE_URL + '/addMessage', message);

    return resp
}